/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package TabelCreate;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import oracle.jdbc.pool.OracleDataSource;

/**
 *
 * @author tea milandi
 */
public class InsertUser {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        String jdbcUrl = "jdbc:oracle:thin:@localhost:1521:XE";
        String userid = "hr"; // gantikan dengan username anda
        String password = "hr"; // gantikan dengan password anda
        try {
            Connection connection = null;
            OracleDataSource ds;
            ds = new OracleDataSource();
            ds.setURL(jdbcUrl);
            ds.setPassword(password);
            ds.setUser(userid);
            connection = (Connection) ds.getConnection();
            Statement statement = connection.createStatement();
            statement.executeQuery("insert into usergudang values ('dio','dio','sleman','087444555333','gudang','dio')");
            statement.executeQuery("insert into usergudang values ('bagus','bagus','nundan','087444555333','toko','bagus')");
            statement.executeQuery("insert into usergudang values ('tea','tea','slamaran','087444555333','gudang','tea')");
            statement.executeQuery("insert into usergudang values ('pandu','gadis','sarkem','087444555333','toko','pandu')");
        } catch (SQLException e) {
// perform error handling here
            System.out.println("error :" + e.getMessage());
        }
    }
}
